<?php
class BaseCommodityModel extends RelationModel {
     public $_link = array(
         'BaseBrand'=>array(
                'mapping_type' =>BELONGS_TO,
                    'class_name'=>'BaseBrand',
                    'foreign_key'=>'brand_id',
                    'mapping_name'=>'brand',
        ),
         'BaseCategory'=>array(
                'mapping_type' =>BELONGS_TO,
                    'class_name'=>'BaseCategory',
                    'foreign_key'=>'category_id',
                    'mapping_name'=>'category',
        ),
        'Share'=>array(
                'mapping_type' =>HAS_MANY,
                    'class_name'=>'Share',
                    'foreign_key'=>'commodity_id',
                    'mapping_name'=>'share',
        ),
        'UserHistory'=>array(
                'mapping_type' =>HAS_MANY,
                    'class_name'=>'UserHistory',
                    'foreign_key'=>'commodity_id',
                    'mapping_name'=>'history',
        ),
        'UserCommodityScore'=>array(
                'mapping_type' =>HAS_MANY,
                    'class_name'=>'UserCommodityScore',
                    'foreign_key'=>'commodity_id',
                    'mapping_name'=>'CommodityScore',
        ),
       
    );
}
?>
